package com.dsbridge.enrollment.dao.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.dsbridge.enrollment.model.CourseAuthorDTO;

public class CourseAuthorRowMapper implements RowMapper<CourseAuthorDTO> {

	@Override
	public CourseAuthorDTO mapRow(ResultSet rs, int arg1) throws SQLException {

		CourseAuthorDTO courseAuthorDTO = new CourseAuthorDTO();
		courseAuthorDTO.setAuthorID(rs.getInt("author_id"));
		courseAuthorDTO.setAuthor(rs.getString("author"));
		courseAuthorDTO.setLoginName(rs.getString("login_name"));
		courseAuthorDTO.setPassword(rs.getString("passsword"));
		courseAuthorDTO.setFirstName(rs.getString("first_name"));
		courseAuthorDTO.setLastName(rs.getString("last_name"));
		courseAuthorDTO.setAddressLine1(rs.getString("address_line1"));
		courseAuthorDTO.setCity(rs.getString("city"));
		courseAuthorDTO.setState(rs.getString("state"));
		courseAuthorDTO.setZipcode(rs.getString("zipcode"));
		return courseAuthorDTO;
	}

}
